package com.billlv.codegenerator.service;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.billlv.codegenerator.domain.dto.DatabaseConnectionDTO;
import com.billlv.codegenerator.domain.vo.DatabaseConnectionVO;
import com.billlv.codegenerator.specification.QueryCondition;

import java.util.List;
/**
 * Service interface for DatabaseConnection.
 * Handles business logic for managing DatabaseConnection.
 */
public interface DatabaseConnectionService {

    /**
     * Create a new DatabaseConnection.
     *
     * @param dto the DatabaseConnection DTO containing creation data
     * @return the created DatabaseConnection as a VO
     */
    DatabaseConnectionVO create(DatabaseConnectionDTO dto);

    /**
     * Retrieve details of a specific DatabaseConnection.
     *
     * @param id the ID of the DatabaseConnection to retrieve
     * @return the DatabaseConnection details as a VO
     */
    DatabaseConnectionVO read(Long id);

    /**
     * Update an existing DatabaseConnection.
     *
     * @param id the ID of the DatabaseConnection to update
     * @param dto the DatabaseConnection DTO containing updated data
     * @return the updated DatabaseConnection as a VO
     */
    DatabaseConnectionVO update(Long id, DatabaseConnectionDTO dto);

    /**
     * Delete a specific DatabaseConnection.
     *
     * @param id the ID of the DatabaseConnection to delete
     */
    void delete(Long id);


    Page<DatabaseConnectionVO> search(
                   List<QueryCondition> conditions,
                  Pageable pageable);

    /**
     * Query DatabaseConnection with pagination and optional keyword search.
     *
     * @param keyword optional search keyword
     * @param pageable pagination details
     * @return a paginated list of DatabaseConnection as VO
     */
    Page<DatabaseConnectionVO> getAll(  Pageable pageable);



}
